#!/bin/sh
rename 's/ /_/g' *
rename 's/ /_/g' */*
rename 's/ /_/g' */*/*/*
rename 's/ /_/g' */*/*/*/*
rename 's/ /_/g' */*/*/*/*/*
for file in `find . -type f -name "*.jpg"`;do
dirname=`dirname $file`
newfile=`echo $file | sed 's,\/,_,g'|sed 's,\._,'$RANDOM',g'`
echo $file $dirname/$newfile;
mv $file $dirname/$newfile;
done